<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2 id="title">{{count}}</h2>
      <button @click="add">+</button>
    </div>
    <script type="module">
      import { createApp, ref, nextTick } from "./vue.esm-browser.js";
      const app = createApp({
        setup() {
          const count = ref(100);
          async function add() {
            count.value++; //101
            console.log(title.innerHTML); //早100
            await nextTick();
            console.log(title.innerHTML);
          }
          return {
            count,
            add,
          };
        },
      });
      app.mount("#app"); //挂载
    </script>
  </body>
</html>
